package tool.lib;

import com.squareup.okhttp.OkHttpClient;

import java.util.concurrent.TimeUnit;

/**
 * Created by Mad on 2015/7/8.
 */
public class OkHttpTool {
    private static OkHttpTool httpTool = new OkHttpTool();
    private OkHttpClient mClient;
    public static OkHttpTool getInstance() {
        return httpTool;
    }

    private OkHttpTool() {
    }
    public static void init()
    {
        httpTool.mClient=new OkHttpClient();
        httpTool.mClient.setConnectTimeout(10, TimeUnit.SECONDS);
        httpTool.mClient.setWriteTimeout(20, TimeUnit.SECONDS);
        httpTool.mClient.setReadTimeout(10,TimeUnit.SECONDS);
    }

    public OkHttpClient getClient() {
        return mClient;
    }
}
